<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function Fn4() {

    }
    Fn4.prototype.msg = '神龙教主'

    let obj1 = new Fn4
    let obj2 = new Fn4			// 

    console.log(obj1.msg)		// 神龙教主
    console.log(obj2.msg)		// 神龙教主

    let tempObj = { uname: 'aaa', age: 19, msg: '你好' }  // 新地址
    Fn4.prototype = tempObj     // 传地址

    console.log(obj1.msg)		// 神龙教主
    console.log(obj2.msg)		// 神龙教主

    console.log(Fn4.prototype)  // {uname:'aaa', age: 19, msg: '你好'}

    let obj666 = new Fn4
//  栈                                堆
//  fn4.prototype 地址0改为地址3     地址0{msg:'神龙教主'} 
//  obj1 地址1                      地址1{__proto__:地址0}
//  obj2 地址2                      地址2{__proto__:地址0}
//  tempObj 地址3                   地址3{uname:'aaa', age: 19, msg: '你好'}
//  obj666 地址4                    地址4{__proto__:地址3}
  </script>
</body>

</html>